<template>
  <t-popup trigger="click" placement="bottom" showArrow>
    <t-button variant="outline">
      {{ plugin.t('create.discount') }} {{ Number(data.order_discount) }}%
    </t-button>
    <template #content>
      <div style="width: 150px;padding:10px 0;overflow: hidden">
        <div style="padding:0 10px 10px 0;">
          <t-input-number v-model="data.order_discount" align="center" :min="0" style="width: 100%" />
        </div>
        <t-button theme="warning" @click="store.orderDiscount()" block>
          {{ $t('common.exec') }}
        </t-button>
      </div>
    </template>
  </t-popup>
</template>
<script setup>
  import store from './store'
  import index from '../../index'

  const plugin = index.plugin
  const data = store.data

</script>